;;;
;;; JaCoLiB
;;; Copyright (C) 2008 Alessandro Serra
;;; 
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;; 
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;; 
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
;;;

;;;; Created on 2008-06-27 22:33:24

(in-package :jacolib)

;
; Jacolib Errors
;

(define-condition jacolib-error (error)
  ((message
    :initarg :message 
    :reader jacolib-error-message
    :documentation "A message describing the error."))
  (:report (lambda (condition stream)
             (format stream "~A : ~A." (type-of condition)
		     (jacolib-error-message condition))))
  (:documentation "A generic error of the jacolib library."))


;
; Protocol Errors
;
 
(define-condition protocol-error (jacolib-error)
  ()
  (:documentation "An error about the communication protocol."))


;
; Evaluation Errors
;

(define-condition eval-error (jacolib-error)
  ()
  (:documentation "An error arised during the evaluation of code by an interpreter."))

(define-condition parser-error (eval-error)
  ()
  (:documentation "A parsing error."))

(define-condition target-error (eval-error)
  ()
  (:documentation "An error arised evaluating codes of an interpreter."))


